<!--  -->
<template>
  <div>
        <Card>
            <div slot="title" >
                <Button v-if="btnp.sblbiao_xzsb" @click="handleClickAddForm" class="zh-hollow" type="primary" icon="plus-round">新增设备</Button>
                <Button v-if="btnp.sblbiao_dr" @click="modal_batch=true" style="marginLeft:25px;" class="zh-hollow" type="warning" >通过EXCEL导入</Button>
            </div>
            <Form :model="formItem" :label-width="70">
                <Row :gutter="10" type="flex"  align="middle"  >
                    <Col span="8">
                        <FormItem label="设备">
                            <Input v-model="formItem.name" placeholder="设备名称/编号" clearable></Input>
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="类型">
                            <Cascader  :data="moreTypeList" v-model="formItem.type" placeholder="请选择父类子类"></Cascader>
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="新增来源">
                            <Select v-model="formItem.source" filterable>
                                <Option  v-for="item in sourceList" :value="item.value" :key="item.value">{{ item.label }}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                    <Col span="8" v-if="user_type!='01'">
                        <FormItem label="所属客户">
                            <Select v-model="formItem.customerUuid" filterable @on-change="searchCustomerChange">
                                <Option  v-for="item in moreCustomerList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                            </Select>
                        </FormItem>
                    </Col> 
                    <Col span="8">
                        <FormItem label="机构">
                            <Input v-if="user_type!='01'" @on-focus="s_tree=true;" :disabled="formItem.customerUuid.length<=0||formItem.customerUuid=='全部'" v-model="formItem.instName" placeholder="请选择机构" readonly></Input>
                            <Input v-else @on-focus="s_tree=true;"  v-model="formItem.instName" placeholder="请选择机构" readonly></Input>
                            <!-- <Select v-if="user_type!='01'" v-model="formItem.inst" filterable :disabled="formItem.customerUuid=='全部'||formItem.customerUuid.length<=0">
                                <Option  v-for="item in moreMechanismList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                            </Select>
                            <Select v-else v-model="formItem.inst" filterable>
                                <Option  v-for="item in moreMechanismList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                            </Select> -->
                        </FormItem>
                    </Col>                                       
                <Col span="8">
                    <FormItem label="设备状态">
                        <Select v-model="formItem.status" filterable>
                            <Option  v-for="item in stateList" :value="item.value" :key="item.value">{{ item.label }}</Option>
                        </Select>
                    </FormItem>
                </Col>

                <Col span="12">
                    <FormItem label="新增时间">
                        <DatePicker :editable='false' v-model="timeRange" format="yyyy-MM-dd HH:mm" type="datetimerange" placement="bottom-end" placeholder="请选择开始和结束时间"></DatePicker>
                    </FormItem>
                </Col>
                
                </Row>
                <Row  >
                <Col span="8" offset="16"  style="text-align:right;">
                    <Button @click='searchGetTable' class="zh-hollow" icon="ios-search-strong" type="primary" >搜索</Button>
                    <!-- <Button v-if="btnp.sblbiao_dc" class="zh-hollow" type="warning" style="margin-left:25px;">导出EXCEL</Button> -->
                    <a style="margin-left:25px;" v-if="btnp.sblbiao_dc" :href="downLoadUrl" target="_blank"><Button  class="zh-hollow" type="warning"  > 导出EXCEL </Button></a>
                </Col>
                
                </Row>
            </Form>
        </Card>
        <Card style="margin-top:10px;" :padding="0">
            <Table :loading="loading" border :columns="columns" :data="data"></Table>
            <Page :current.sync="formItem.pageNumber"  :total="total" show-total show-sizer @on-change="pageChange" @on-page-size-change="pageSizeChange"></Page>
        </Card>
        <Modal :loading='transferLoad' title="流转" @on-ok='transferSave' v-model="modal_circulation" ok-text="保存" cancel-text="放弃操作" >
            <Form :label-width="60" style="padding:15px 30px">
                <FormItem label="流转到">
                    <Row>
                        <Col :span='12'>
                            <Select v-if="modal_circulation" v-model="transferInst" filterable @on-change="instChange">
                                <Option  v-for="item in instlist" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                            </Select>
                        </Col>
                        <Col :span='12' v-if="modal_circulation&&transferPartlist.length>0">
                            <Select  v-model="transferPart" filterable>
                                <Option  v-for="item in transferPartlist" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                            </Select>
                        </Col>
                    </Row>
                </FormItem>
            </Form>
        </Modal>
        <Modal  title="流转记录" v-model="modal_cirRe" class=" no_footer_modal" class-name="vertical-center-modal">
            <Table  border :columns="transfercolumns" :data="transferdata"></Table>
            <div style="paddingRight:30px;">
                <Page 
                    :current.sync="transferPageNumber"  
                    :total="transferTotal" 
                    show-total
                    :page-size="transferPageSize"
                    @on-change="transferPageChange" 
                ></Page>
            </div>
        </Modal>
        <Modal  title="设备二维码" v-model="modal_qr"  class-name="vertical-center-modal">
            <div style="padding:15px 30px;textAlign:center" >
                <img style="display:block;width:180px;height:180px;margin: 0 auto;" :src="qrcodeinfo.qrcode" alt="">
            </div>
            <div slot="footer">
                <div style="textAlign:center;width:100%;">
                    <!-- <a target="_blank" :href="qrcodeinfo.qrcode" :download="qrcodeinfo.name+'.jpg'"><Button  @click="downQrPic" class="zh-hollow" type="primary" icon="ios-download-outline">
                        下载
                    </Button>
                    </a> -->
                    <Button  @click="downQrPic" class="zh-hollow" type="primary" icon="ios-download-outline">
                        下载
                    </Button>
                </div>
                
            </div>
        </Modal>
        <Modal 
            :title="deviceInfoTitle" 
            v-model="modal_deviceInfo" 
            :class="classes" 
            ok-text="保存" 
            cancel-text="放弃操作"
            :loading='saveLoad'
            @on-ok="validate"
        >
            <Form style="padding:15px 30px;" v-if="infotype==='view'" :model="deviceInfo" :label-width="90">
                <FormItem v-if="user_type!='01'" label="所属客户：">
                    {{deviceInfo.customer_name}}
                </FormItem>
                <FormItem label="所属机构：">
                    {{deviceInfo.inst_name}}
                </FormItem>
                <FormItem label="所在部门：">
                    {{deviceInfo.part_name}}
                </FormItem>
                <FormItem label="设备类型：">
                    {{deviceInfo.eqyipType}}
                </FormItem>
                <FormItem label="设备名称：">
                    {{deviceInfo.name}}
                </FormItem>
                <FormItem label="品牌：">
                    {{deviceInfo.brand}}
                </FormItem>
                <FormItem label="采购日期：">
                    {{deviceInfo.date}}
                </FormItem>
                <FormItem label="采购金额：">
                    {{deviceInfo.amt}}
                </FormItem>
                <FormItem v-if="!deviceInfo.more"  >
                    <Button type="text" @click="deviceInfo.more=true" icon="ios-arrow-thin-down">更多信息</Button>
                </FormItem>
                <template v-if="deviceInfo.more">
                    <FormItem label="设备序列号：">
                        {{deviceInfo.sn}}
                    </FormItem>
                    <FormItem label="资产编号：">
                        {{deviceInfo.assets_code}}
                    </FormItem>
                    <FormItem label="领用人：">
                        {{deviceInfo.receiptor}}
                    </FormItem>
                    <FormItem label="领用时间：">
                        {{deviceInfo.receipt_time}}
                    </FormItem>
                    <FormItem label="IP地址：">
                        {{deviceInfo.ip}}
                    </FormItem>
                    <FormItem label="mac地址：">
                        {{deviceInfo.mac}}
                    </FormItem>
                    <FormItem label="厂商支持人：">
                        {{deviceInfo.facilitator}}
                    </FormItem>
                    <FormItem label="厂商支持电话：">
                        {{deviceInfo.facilitator_tel}}
                    </FormItem>
                    <FormItem label="备注：">
                        {{deviceInfo.remark}}
                    </FormItem>
                    <FormItem   >
                        <Button type="text" @click="deviceInfo.more=false" icon="ios-arrow-thin-up" >收起信息</Button>
                    </FormItem>
                </template>
            </Form>
            <Form style="padding:15px 30px;" v-else :model="deviceInfo" :label-width="90">
                <FormItem label="所属客户*" v-if="user_type!='01'">
                    <Select v-if="modal_deviceInfo" v-model="deviceInfo.customerUuid" filterable @on-change='formCustomerChange'>
                        <Option  v-for="item in customerList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                    </Select>
                </FormItem>
                <FormItem label="所属机构*">
                    <Input v-if="user_type!=='01'" @on-focus="f_tree=true;" :disabled="deviceInfo.customerUuid==undefined||deviceInfo.customerUuid==''" v-model="deviceInfo.inst_name" placeholder="请选择机构" readonly></Input>
					<Input v-else @on-focus="f_tree=true;" :disabled="!deviceInfo.location[0]" v-model="deviceInfo.inst_name" placeholder="请选择机构" readonly></Input>
                    <!-- <Select @on-change="changeInst" v-if="user_type!=='01'" :disabled="deviceInfo.customerUuid==undefined||deviceInfo.customerUuid==''" v-model="deviceInfo.instUuid" filterable>
                        <Option  v-for="item in mechanismList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                    </Select>
                    <Select @on-change="changeInst" v-else  v-model="deviceInfo.instUuid" filterable>
                        <Option  v-for="item in mechanismList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                    </Select> -->
                </FormItem>
                <FormItem label="所在部门">
                    <Select v-model="deviceInfo.deptUuid" filterable :disabled="deviceInfo.instUuid==undefined||deviceInfo.instUuid==''">
                        <Option  v-for="item in partList" :value="item.uuid" :key="item.uuid">{{ item.name }}</Option>
                    </Select>
                </FormItem>
                <FormItem label="设备类型*">
                    <Cascader :data="typeList" v-model="deviceInfo.type"></Cascader>
                </FormItem>
                <FormItem label="设备名称*">
                    <Input v-model="deviceInfo.name" clearable :maxlength="20"></Input>
                </FormItem>
                <FormItem label="品牌">
                    <Input v-model="deviceInfo.brand" clearable :maxlength="20"></Input>
                </FormItem>
                <FormItem label="采购日期">
                    <DatePicker :editable='false'  v-model="deviceInfo.date"    type="date" @on-change="changeDate" clearable></DatePicker>
                    <!-- <DatePicker :editable='false' v-if="!!deviceInfo.date" v-model="deviceInfo.date"    type="date" @on-change="changeDate" clearable></DatePicker>
                    <DatePicker v-else :editable='false'   type="date" @on-change="changeDate" clearable></DatePicker> -->
                </FormItem>
                <FormItem label="采购金额">
                    <Input v-model="deviceInfo.amt" @on-keyup="amtChange"  clearable :maxlength="9"></Input>
                </FormItem>
                <FormItem v-if="!deviceInfo.more"  >
                    <Button type="text" @click="deviceInfo.more=true" icon="ios-arrow-thin-down" >更多信息</Button>
                </FormItem>
                <template v-if="deviceInfo.more">
                    <FormItem label="设备序列号">
                        <Input v-model="deviceInfo.sn" clearable></Input>
                    </FormItem>
                    <FormItem label="资产编号">
                        <Input v-model="deviceInfo.assets_code" clearable ></Input>
                    </FormItem>
                    <FormItem label="领用人">
                        <Input v-model="deviceInfo.receiptor" clearable :maxlength="20"></Input>
                    </FormItem>
                    <FormItem label="领用时间">
                        <DatePicker :editable='false'  v-model="deviceInfo.dateTime"  type="datetime" format="yyyy-MM-dd HH:mm" @on-change="changeDateTime"  ></DatePicker>
                        <!-- <DatePicker :editable='false' v-if="!!deviceInfo.dateTime" v-model="deviceInfo.dateTime"  type="datetime" format="yyyy-MM-dd HH:mm" @on-change="changeDateTime"  ></DatePicker> -->
                        <!-- <DatePicker :editable='false' v-else   type="datetime" format="yyyy-MM-dd HH:mm" @on-change="changeDateTime"  ></DatePicker> -->
                    </FormItem>
                    <FormItem label="IP地址">
                        <Input v-model="deviceInfo.ip" clearable :maxlength="20"></Input>
                    </FormItem>
                    <FormItem label="mac地址">
                        <Input v-model="deviceInfo.mac" clearable :maxlength="20"></Input>
                    </FormItem>
                    <FormItem label="厂商支持人">
                        <Input v-model="deviceInfo.facilitator" clearable :maxlength="20"></Input>
                    </FormItem>
                    <FormItem label="厂商支持电话">
                        <Input v-model="deviceInfo.facilitator_tel" clearable :maxlength="20"></Input>
                    </FormItem>
                    <FormItem label="备注">
                        <Input v-model="deviceInfo.remark" clearable :maxlength="20"></Input>
                    </FormItem>
                    <FormItem   >
                        <Button type="text" @click="deviceInfo.more=false" icon="ios-arrow-thin-up" >收起信息</Button>
                    </FormItem>
                </template>
            </Form>
        </Modal>
        <Modal width="600" title="维护记录" v-model="modal_mtRe"  class=" no_footer_modal">
            <Table  border :columns="recolumns" :data="redata"></Table>
            <div style="paddingRight:30px;">
                <Page 
                    :current.sync="recordsPageNumber"  
                    :total="recordsTotal" 
                    show-total
                    :page-size="recordsPageSize"
                    @on-change="recordsPageChange" 
                    
                ></Page>
            </div>
             
        </Modal>
        <!-- 维修详情 -->
        <Modal title="维修详情"  v-model="modal_repaire_detail" class="no_footer_modal" >
            <!-- <p slot="header" >维修详情</p> -->
            <div class="detail-form">
                <div class="detail-form-item">
                <label>维修单号：</label>
                <span>{{repaire_details.order_number}}</span>
                </div>
                <div class="detail-form-item">
                <label>报修时间：</label>
                <span>{{repaire_details.startTime}}</span>
                </div>
                <div class="detail-form-item">
                <label>报修人：</label>
                <span>{{repaire_details.name}}</span>
                </div>
                <div class="detail-form-item">
                <label>联系电话：</label>
                <span>{{repaire_details.mobile}}</span>
                </div>
                <div class="detail-form-item" v-if="user_type!=='01'">
                <label>客户：</label>
                <span>{{repaire_details.customername}}</span>
                </div>
                <div class="detail-form-item">
                <label>所在地：</label>
                <span>{{repaire_details.location}}</span>
                </div>
                <div class="detail-form-item">
                <label>机构：</label>
                <span>{{repaire_details.inst_name}}</span>
                </div>
                <div class="detail-form-item">
                <label>报修设备：</label>
                <span v-if="!!repaire_details.equip" style="color:#2d8cf0">{{repaire_details.equip}}</span>
                </div>
                <div class="detail-img-video">
                <span>故障描述：</span>
                <p v-if="!!repaire_details.describe">{{repaire_details.describe}}</p>
                <div v-if="repaire_details.imageList>0" class="wrap">
                    
                    <img v-for="(item,i) in repaire_details.imageList"  :key="i" :src="item" @click="handleClickPicLook(item)" alt="">
                </div>
                <div v-if="!!repaire_details.video" class="wrap">
                    <video poster="" @click="handleClickVideoPlay(repaire_details.video)"  :src="repaire_details.video"></video>
                </div>
                </div>
            </div>
            <div v-if="repaire_details.additional.length>0" class="detail-supplement">
                <div v-for="(item,i) in repaire_details.additional" :key="i" class="detail-supplement-item">
                <div class="spokesman">
                    <Avatar icon="person" size="large" :src="item.image" />
                    <div style="marginLeft:10px;">
                    <p>{{item.name}}</p>
                    <p>{{item.created}}</p>
                    </div>
                </div>
                <div class="speech" >
                    <p v-if="item.describe.length>0">{{item.describe}}</p>
                    <Row v-if="item.imageList.length>0" :gutter="15" type="flex" align="middle">
                    <Col v-for="(child,index) in item.imageList" :key="index" span="6">
                        <img :src="child" alt="" style="width:100%">
                    </Col>
                    </Row>
                </div>
                </div>
            </div>
            <div class="detail-other zh-flex zh-flex-3" v-if="!!repaire_details.remarks&&!!repaire_details.remarks.pro">
                <div class="detail-other-item"><label>运维人员：</label>{{repaire_details.proName}}</div>
                <div class="detail-other-item"><label>故障类型：</label>{{repaire_details.faultType}}</div>
                <div class="detail-other-item"><label>故障原因：</label>{{repaire_details.reason}}</div> 
                <div class="detail-other-item"><label>处理办法：</label>{{repaire_details.solve}}</div>
            </div>
            <div class="detail-other zh-flex zh-flex-3" v-if="!!repaire_details.skill_score">
                <div class="detail-other-item"><label>专业技能：</label>{{repaire_details.skill_score}}</div>
                <div class="detail-other-item"><label>响应速度：</label>{{repaire_details.speed_score}}</div>
                <div class="detail-other-item"><label>服务态度：</label>{{repaire_details.attitude_score}}</div>
                <div class="detail-other-item"><label>其他评价：</label>{{repaire_details.content}}</div>
            </div>
            </Modal>
            <!-- 查看图片 -->
            <Modal title="查看图片" v-model="look_pic_wrap.look_pic" class="no_footer_modal">
            <img style="width:100%;" :src="look_pic_wrap.src" alt="">
        </Modal>
        <!-- 看视频 -->
        <Modal title="查看视频" v-model="look_video_wrap.look_video" class="no_footer_modal">
        <video style="width:100%;" :src="look_video_wrap.src" controls alt=""></video>
        </Modal>
        <Modal v-model="modal_batch" title="批量新增"  class-name="vertical-center-modal">
                <div style="padding:15px 30px;">
                    <p>从本地选择Excel格式的办公用品列表，批量导入办公用品。</p>
                    <a :href="url_equipListTemp"><Button type="text" style="color:#2d8cf0" >下载Excel模板</Button></a>
                </div>
                <div slot="footer" class="zh-flex zh-flex-5 excel" style="width:100%;">
                        <Button @clcik="modal_batch=false;" type="ghost">放弃操作</Button>
                        <Upload 
                        ref="upload"
                        :with-credentials="true"
                        :on-success="handleSuccessExcel"
                        :on-progress="handleProgressExcel"
                        :format="['xlsx','xls']"
                        :on-format-error="handleFormatErrorExcel"
                        :before-upload="handleBeforeUploadExcel"
                        :action="dr_url_sblb">
                            <Button type="primary" :loading="btnloading" class="zh-hollow">选择文件</Button>
                        </Upload>
                </div>
        </Modal>
        <Modal title="选择机构" v-model="s_tree" @on-ok="confirmST" :mask-closable="false" >
            <div style="padding:15px 30px;">
                <Tree :data="s_tree_data"   @on-select-change="s_selectChange"></Tree>
            </div>
        </Modal>
        <Modal title="选择机构" v-model="f_tree" :loading="ft_load" @on-ok="confirmF" :mask-closable="false" >
			<div style="padding:15px 30px;">
				<Tree :data="f_tree_data"   @on-select-change="f_selectChange"></Tree>
			</div>
		</Modal>
    </div>
</template>

<script>
import {url_equipList,url_equipListTemp,dr_url_sblb,downQr} from '@/libs/downLoadUrl'
import accounting from 'accounting'
import util from '@/libs/util.js'
import {
    getBankOrg,
    getDeptList,
    getEquipTable,
    getEquipType,
    getQRcode,
    getEquipRepaireRecords,
    downloadQR,
    getRepaireDetails,
    getEquipTransferRecords,
    getOrgTree
} from '@/libs/get.js'
import {
    saveEquip,
    saveTransfer,
    scrapEquip,
    deleteEquip
} from '@/libs/post.js'
export default {
    name:'',
    data () {
        return {
            ft_load:true,
			f_select_op:[],
			f_tree_data:[],
			f_tree:false,
            s_select_op:[],
			s_tree_data:[],
			s_tree:false,
            btnloading:false,
            dr_url_sblb:dr_url_sblb,
            url_equipListTemp:url_equipListTemp,
            modal_batch:false,
            downLoadUrl:url_equipList,
            editInstN:'',
            editInst:'',
            editDept:'',
            transferLoad:true,
            transfercolumns:[
                {
                    key:'time',
                    title:'时间',
                    width:150
                },{
                    key:'desc',
                    title:'内容'
                }
            ],
            transferdata:[],
            transferTotal:0,
            transferPageSize:8,
            transferPageNumber:1,
            equipUuid:'',
            recordsPageNumber:1,
            recordsTotal:0,
            recordsPageSize:8,
            saveLoad:true,
            domain:this.$store.state.app.domain,
            user_type:'',
            userUuid:'',
            btnp:{},
            btn:{
                sblbiao_xzsb:false,
                sblbiao_dr:false,
                sblbiao_dc:false,
                sblbiao_ewm:false,
                sblbiao_sbxx:false,
                sblbiao_whjl:false,
                sblbiao_lzjl:false,
                sblbiao_bj:false,
                sblbiao_lz:false,
                sblbiao_bf:false,
                sblbiao_hf:false,
                sblbiao_sc:false
            },
           /**看视频 */
            look_video_wrap:{
                look_video:false,
                src:''
            },
            /** 查看图片*/
            look_pic_wrap:{
                look_pic:false,
                src:''
            },
            /**维修详情 */
            modal_repaire_detail:false,
            empty_repaire_details:{},
            repaire_details:{
                order_number:'',
                startTime:'',
                name:'',
                mobile:'',
                customername:'',
                location:'',
                inst_name:'',
                equip:'',
                describe:'',
                imageList:[],
                video:'',
                additional:[],
                proName:'',
                faultType:'',
                reason:'',
                rsolve:'',
                attitude_score:'',
                skill_score:'',
                speed_score:'',
                content:''
            },
            recolumns:[
                {
                    key:'time',
                    title:'报修时间',
                    minWidth:150
                },
                {
                    key:'order_number',
                    title:'报修单号',
                    minWidth:149,
                    render:(h,params)=>{
                        return h('Button',{
                            props:{
                            type:'text',
                            size:'small'
                            },
                            style:{
                            color:'#2D8CF0'
                            },
                            on:{
                                click:()=>{
                                    this.getDetails(params.row.uuid);
                                }
                            }
                        },params.row.order_number)
                    }
                },
                {
                    key:'stateNm',
                    title:'维修状态',
                    minWidth:99
                },
                {
                    key:'faultTypeName',
                    title:'故障类型',
                    minWidth:100
                },
                {
                    key:'name',
                    title:'维护人员',
                     minWidth:100
                },
            ],
            redata:[],
            modal_mtRe:false,
            infotype:'',//add,edit,view
            classes:'',
            deviceInfoTitle:'',
            modal_deviceInfo:false,
            deviceInfo:{
                more:false,
                uuid:'',
                type:['',''],
                date:'',
                dateTime:'',
                customerUuid:'',
                customer_name:'',
                inst_name:'',
                instUuid:'',
                part_name:'',
                deptUuid:'',
                bussinesUuid:'',
                typeCdUuid:'',
                name:'',
                eqyipType:'',
                brand:'',
                purchaseDate:'',
                amt:'',
                sn:'',
                assets_code:'',
                receiptor:'',
                receipt_time:'',
                ip:'',
                mac:'',
                facilitator:'',
                facilitator_tel:'',
                remark:''
            },
            modal_qr:false,
            qrcodeinfo:{
                qrcode:'',
                number:'',
                type:[],
                name:''
            },
            modal_cirRe:false,
            transferInst:'',
            transferPart:'',
            instlist:[],
            transferPartlist:[],
            modal_circulation:false,
            loading:true,
            total:0,
            timeRange:[],
            formItem:{
                inst:'全部',
                name:'',
                instName:'',
                type:['全部','全部'],
                customerUuid:'全部',
                status:'全部',
                source:'全部',
                startTime:'',
                endTime:'',
                pageNumber:1,
                pageSize:10 
            },
            moreCustomerList:[],
            customerList:[],
            moreMechanismList:[],
            mechanismList:[],
            moreTypeList:[],
            typeList:[] ,
            partList:[ ] ,
            sourceList:[
                {
                    value:'全部',
                    label:'全部'
                },
                {
                    value:'2',
                    label:'管理后台'
                },
                {
                    value:'1',
                    label:'运维人员（APP）'
                }
            ],
            stateList:[
                {
                    value:'全部',
                    label:'全部'
                },
                {
                    value:'0',
                    label:'正常'
                },
                {
                    value:'2',
                    label:'报废'
                }
            ],
            columns:[
                {
                    key:'code',
                    title:'设备编号',
                    fixed:'left',
                    minWidth:150
                },
                {
                    key:'name',
                    title:'设备名称',
                    minWidth:150
                },
                {
                    key:'eqyipType',
                    title:'类型',
                    minWidth:150
                },
                {
                    key:'customerName',
                    title:'所属客户',
                    minWidth:150
                },
                {
                    key:'iname',
                    title:'所属机构',
                    minWidth:150
                },
                {
                    key:'time',
                    title:'新增时间',
                    minWidth:150,
                    align:'center'
                },
                {
                    key:'come_from_desc',
                    title:'新增来源',
                    minWidth:100
                },
                {
                    key:'statusNm',
                    title:'设备状态',
                    minWidth:90,
                },
                {
                key:'action',
                title:'操作',
                align:'center',
                minWidth:300,
                fixed:'right',
                render:(h,params)=>{
                    //判断是否显示某些操作按钮
                    let uuid=params.row.uuid;
                    let status=params.row.status;
                    return h('div',[
                    h('Button',{
                        props:{
                        type:'text',
                        size:'small'
                        },
                        style:{
                        color:'#2D8CF0',
                        display:this.btnp.sblbiao_ewm?'inline-block':'none'
                        },
                        on:{
                        click:()=>{
                            this.qrcodeinfo={
                                qrcode:params.row.qrcode,
                                number:params.row.code,
                                type:params.row.eqyipType,
                                name:params.row.name
                            };
                            this.modal_qr=true;
                            this.equipUuid=params.row.uuid;
                        }
                        }
                    },'二维码'),
                    h('Button',{
                        props:{
                        type:'text',
                        size:'small'
                        },
                        style:{
                        color:'#2D8CF0',
                        display:this.btnp.sblbiao_sbxx?'inline-block':'none'
                        },
                        on:{
                        click:()=>{
                            
                            this.infotype='view';
                            this.getRowInfo(params.row);
                            this.modal_deviceInfo=true;
                        }
                        }
                    },'设备信息'),
                    h('Button',{
                        props:{
                        type:'text',
                        size:'small'
                        },
                        style:{
                        color:'#2D8CF0',
                        display:this.btnp.sblbiao_whjl?'inline-block':'none'
                        },
                        on:{
                        click:()=>{
                            this.equipUuid=params.row.uuid;
                            this.recordsPageNumber=1;
                            this.getRecords(this.equipUuid,this.recordsPageNumber,this.recordsPageSize);
                            
                        }
                        }
                    },'维护记录'),
                    h('Button',{
                        props:{
                        type:'text',
                        size:'small'
                        },
                        style:{
                        color:'#2D8CF0',
                        display:this.btnp.sblbiao_lzjl?'inline-block':'none'
                        },
                        on:{
                        click:()=>{
                            this.equipUuid=params.row.uuid;
                            this.transferPageNumber=1;
                            this.getTransferRecords(this.equipUuid,this.transferPageNumber,this.transferPageSize);
                        }
                        }
                    },'流转记录'),
                    h('Button',{
                        props:{
                        type:'text',
                        size:'small'
                        },
                        style:{
                        color:'#2D8CF0',
                        display:this.btnp.sblbiao_bj?status=='0'?'inline-block':'none':'none'
                        },
                        on:{
                        click:()=>{
                            this.infotype='edit';
                            this.getRowInfo(params.row);
                            
                        }
                        }
                    },'编辑'),
                 h('Button',{
                        props:{
                        type:'text',
                        size:'small'
                        },
                        style:{
                        color:'#2D8CF0',
                        display:this.btnp.sblbiao_lz?status=='0'?'inline-block':'none':'none'
                        },
                        on:{
                            click:async ()=>{
                                this.equipUuid=params.row.uuid;
                                this.transferInst=params.row.inst;
                                this.transferPart=params.row.department;
                                await this.getTransferInst(params.row.customerUuid);
                                await this.getTrnasferPartList(params.row.inst);
                                this.modal_circulation=true;
                            }
                        }
                    },'流转'),                 
                    h('Button',{
                        props:{
                        type:'text',
                        size:'small'
                        },
                        style:{
                        color:'#2D8CF0',
                        display:this.btnp.sblbiao_hf?status=='2'?'inline-block':'none':'none'
                        },
                        on:{
                        click:()=>{
                            let config={
                            title:'恢复设备',
                            content:'将报废设备恢复后，设备可以继续被运维人员维护。',
                            okText:'恢复',
                            cancelText:'放弃操作',
                            onOk:()=>{
                                this.equipisok(params.row.uuid,params.row.inst,params.row.iname,'unfreezon')
                            }
                            }
                            this.$Modal.confirm(config)
                        }
                        }
                    },'恢复 '),                 
                    h('Button',{
                        props:{
                        type:'text',
                        size:'small'
                        },
                        style:{
                        color:'#2D8CF0',
                        display:this.btnp.sblbiao_bf?status=='0'?'inline-block':'none':none
                        },
                        on:{
                        click:()=>{
                            let config={
                            title:'报废设备',
                            content:'报废的设备不能被报修，运维人员也不能对设备信息进行编辑。',
                            render:h=>{
                                return h('div',{
                                    style:{
                                        padding:'30px 30px 0 30px',
                                        textAlign:'left'
                                    }
                                },[
                                    h('p','报废的设备不能被报修，运维人员也不能对设备信息进行编辑。'),
                                    h('p','正在维修中的设备，报废时同时会自动将进行中的维修任务撤销。')
                                ])
                            },
                            okText:'报废',
                            cancelText:'放弃操作',
                            onOk:()=>{
                                this.equipisok(params.row.uuid,params.row.inst,params.row.iname,'freezon')
                            }
                            }
                            this.$Modal.confirm(config)
                        }
                        }
                    },'报废'),
                    h('Button',{
                        props:{
                        type:'text',
                        size:'small'
                        },
                        style:{
                        color:'#EA0000',
                        display:this.btnp.sblbiao_sc?status=='2'?'inline-block':'none':'none'
                        },
                        on:{
                        click:()=>{
                            let config={
                            title:'删除设备',
                            content:'设备删除后不可被恢复。',
                            okText:'删除',
                            cancelText:'放弃操作',
                            onOk:()=>{
                                this.delete(params.row.uuid);
                            }
                            }
                            this.$Modal.confirm(config)
                        }
                        }
                    },'删除')
                    ])
                }
                }
                
            ],
            data:[]        
        };
    },
    methods:{
        init(){
            let that=this;
            util.isCustomer(this);
            this.empty_repaire_details=JSON.parse(JSON.stringify(this.repaire_details));
            let timer;
			if(that.user_type!=='01'){
				timer=setInterval(()=>{
					if(that.$store.state.user.customer.length>0){
                        that.moreCustomerList=[{name:'全部',uuid:'全部'},...that.$store.state.user.customer];
                        that.customerList=that.$store.state.user.customer;
						clearInterval(timer)	
					}
				},500);
			}else{
                this.searchCustomerChange(this.userUuid);	
                //this.newSearchCustomerChange(this.userUuid,'search');	
                //this.newSearchCustomerChange(this.userUuid,'form'); 
                this.getFormInstTree(this.userUuid);
			}
            // setTimeout(()=>{
            //     if(this.user_type!=='01'){
            //         that.moreCustomerList=[{name:'全部',uuid:'全部'},...that.$store.state.user.customer];
            //         that.customerList=that.$store.state.user.customer;
            //     }
            // },5000);
            // if(this.user_type=='01'){   
            //     this.newSearchCustomerChange(this.userUuid,'search');
            //     this.newSearchCustomerChange(this.userUuid,'form'); 
            // } 
        },
        async getFormInstTree(value,p,c,d){
			this.deviceInfo.instUuid='';
			this.deviceInfo.inst_name='';
			this.f_select_op=[];
			if(value!==''){
				let res=await getOrgTree(value,p,c,d);
				let response=res.data;
				if(response.code===200){
					this.f_tree_data=util.tree([response.data]);
				}else{
					this.$Notice.error({
						title: '获取机构失败',
						desc:response.msg
					});
				}
			}
		},
		f_selectChange(selectarr){
			this.f_select_op=selectarr;
		},
		async confirmF(){
			if(this.f_select_op.length>0){
				if(this.f_select_op[0].canChoose=='true'){
					this.deviceInfo.instUuid=this.f_select_op[0].value;
                    this.deviceInfo.inst_name=this.f_select_op[0].title;
                    await this.changeInst(this.f_select_op[0].value);
				}else{
					this.$Notice.error({
						desc:'请选择有效节点'
					});
					this.ft_load=false;
					let that=this;
					setTimeout(() => {
						that.ft_load=true;
					}, 200);
					return false
				}
				
			}else{
				this.deviceInfo.instUuid='';
				this.deviceInfo.inst_name='';
			}
			this.f_tree=false;
		},
        async getSearchInstTree(value){
            this.formItem.inst='';
            this.formItem.instName='';
            this.s_select_op=[];
			if(value!=='全部'){
				let res=await getOrgTree(value);
				let response=res.data;
				if(response.code===200){
					this.s_tree_data=util.tree([response.data]);
				}else{
					this.$Notice.error({
						title: '获取机构失败',
						desc:response.msg
					});
				}
			}
		},
		s_selectChange(selectarr){
			this.s_select_op=selectarr;
		},
		confirmST(){
			if(this.s_select_op.length>0){
				this.formItem.inst=this.s_select_op[0].value;
				this.formItem.instName=this.s_select_op[0].title;
			}else{
				this.formItem.inst='';
				this.formItem.instName='';
			}
		},
        handleSuccessExcel(res, file){
            if(res.code==200){
                this.$Notice.success({
                    desc:res.msg
                });
                this.modal_batch=false;
                this.getTable();
            }else{
                this.$Notice.error({
                    desc:res.msg
                })
            }
            this.btnloading=false;
        },
        handleProgressExcel(){
            this.btnloading=true;
        },
        handleBeforeUploadExcel(){

        },
        handleFormatErrorExcel (file) {
            this.$Notice.warning({
                title: '文件格式错误',
                desc: '请选择 xlsx 或xls 格式的文件'
            });
        },
        async delete(uuid){
            let res =await deleteEquip(uuid);
            let response=res.data;
            if(response.code==200){
                this.$Notice.success({
                    desc:"已删除"
                });
                this.getTable();
            }else{
                this.$Notice.error({
                    desc:response.msg
                })
            }
        },
        async equipisok(uuid , instUuid , iname , flag){
            let res =await scrapEquip(uuid , instUuid , iname , flag);
            let response=res.data;
            if(response.code==200){
                this.$Notice.success({
                    desc:flag=='freezon'?"已报废":"已恢复"
                });
                this.getTable();
            }else{
                this.$Notice.error({
                    desc:response.msg
                })
            }
        },
        async transferSave(){
            let uuid=this.equipUuid;
            let inst=this.transferInst;
            let department=this.transferPart;
            if(this.transferPartlist.length<=0){
                department=''
            }else{
                let arr=this.transferPartlist.map(item=>{
                    return item.uuid
                });
                if(!arr.includes(department)){
                    department='';
                }
            }
            let res =await saveTransfer({uuid,inst,department});
            let response=res.data;
            if(response.code==200){
                this.$Notice.success({
                    desc:"已保存"
                });
                this.modal_circulation=false;
                this.getTable();
            }else{
                this.$Notice.error({
                    desc:response.msg
                })
            }
            let that=this;
            this.transferLoad=false;
            setTimeout(()=>{
                that.transferLoad=true;
            },500)
        },
        transferPageChange(num){
            this.transferPageNumber=number;
            this.getTransferRecords(this.equipUuid,number,this.transferPageSize);
            this.getTable();
        },
        instChange(value){
            this.getTrnasferPartList(value);
        },
        async getTrnasferPartList(uuid){
            let res =await getDeptList(uuid);
            let response=res.data;
            if(response.code==200){
                this.transferPartlist=response.data;
            }else{
                this.$Notice.error({
                    desc:response.msg
                })
            }
        },
        async getTransferRecords(uuid,pageNumber,pageSize){
            let res=await getEquipTransferRecords(uuid,pageNumber,pageSize);
            let response=res.data;
            if(response.code==200){
                this.transferTotal=response.data.total;
                this.transferdata=response.data.rows.map(item=>{
                    item.time=item.created.slice(0,11);
                    return item
                });
                this.modal_cirRe=true;
            }else{
                this.$Notice.error({
                    desc:response.msg
                });
            }
        },
        recordsPageChange(num){
            this.recordsPageNumber=number;
            this.getRecords(this.equipUuid,number,this.recordsPageSize)
        },
        async getRecords(uuid,pageNumber,pageSize){
            let res=await getEquipRepaireRecords(uuid,pageNumber,pageSize);
            let response=res.data;
            if(response.code==200){
                this.recordsTotal=response.data.total;
                this.redata=response.data.rows.map(item=>{
                    item.time=item.created.slice(0,16);
                    return item
                });
                this.modal_mtRe=true;
            }else{
                this.$Notice.error({
                    desc:response.msg
                });
            }
        },
        amtChange(e){
            let amt=util.amount(this.deviceInfo.amt);
            this.$set(this.deviceInfo,'amt',amt);
        },
        async getQR(uuid){
            let res=await getQRcode(uuid);
            let response=res.data;
            if(response.code==200){
                this.qrcodeinfo.qrcode=response.data;
                this.modal_qr=true;
            }else{
                this.$Notice.error({
                    desc:response.msg
                });
            }
        },
        async getRowInfo(obj){
            this.deviceInfo={
                more:false,
                uuid:obj.uuid,
                type:[obj.bussines_uuid,obj.type_cd_uuid],
                customerUuid:obj.customerUuid,
                customer_name:obj.customerName,
                inst_name:obj.iname,
                instUuid:obj.inst,
                part_name:obj.departmentName,
                deptUuid:obj.department,
                bussinesUuid:obj.bussines_uuid,
                typeCdUuid:obj.type_cd_uuid,
                eqyipType:obj.eqyipType,
                name:!!obj.name?obj.name:'',
                brand:obj.brand,
                amt:obj.amt,
                sn:obj.sn,
                assets_code:obj.assets_code,
                receiptor:obj.receiptor,
                ip:obj.ip,
                mac:obj.mac,
                facilitator:obj.facilitator,
                facilitator_tel:obj.facilitator_tel,
                remark:obj.remark,
                purchaseDate:!!obj.purchase_date?obj.purchase_date.slice(0,10):'',
                receipt_time:!!obj.receipt_time?obj.receipt_time.slice(0,16):'',
                date:!!obj.purchase_date?obj.purchase_date.slice(0,10):'',
                dateTime:!!obj.receipt_time?obj.receipt_time.slice(0,16):'',
            };
            this.editInst=obj.inst;
            this.editInstN=obj.iname;
            this.editDept=obj.department;
            if(this.infotype=='view'){
                this.deviceInfo.amt=accounting.formatMoney(accounting.unformat(this.deviceInfo.amt),'',2,',')
            }else{
                await this.getFormInstTree(obj.customerUuid);
                //await this.newSearchCustomerChange(obj.customerUuid,'form');
                this.f_tree_data=util.TreeFormat2(this.f_tree_data,this.editInst);
                this.deviceInfo.instUuid=this.editInst;
                this.deviceInfo.inst_name=this.editInstN;
                if(!!obj.inst||obj.inst.length>0){
                    await this.changeInst(obj.inst);
                    this.deviceInfo.deptUuid= this.editDept;
                }
                this.modal_deviceInfo=true;
            }
        },
        async downQrPic(){
            let name=this.qrcodeinfo.qrcode;
            let uuid=this.equipUuid;
            
            let download=window.open(`${downQr}&uuid=${uuid}&name=${name}`,'_blank');
                let that=this;
                download.onbeforeunload=function(){
                    
                };
        },
        resetForm(){
            this.deviceInfo={
                more:false,
                uuid:'',
                type:['',''],
                date:'',
                dateTime:'',
                customerUuid:'',
                customer_name:'',
                inst_name:'',
                instUuid:'',
                part_name:'',
                deptUuid:'',
                bussinesUuid:'',
                typeCdUuid:'',
                eqyipType:'',
                name:'',
                brand:'',
                purchaseDate:'',
                amt:'',
                sn:'',
                assets_code:'',
                receiptor:'',
                receipt_time:'',
                ip:'',
                mac:'',
                facilitator:'',
                facilitator_tel:'',
                remark:''
            }
        },
        async save(){
            let form=JSON.parse(JSON.stringify(this.deviceInfo));
            if(this.user_type=='01'){
                form.customerUuid=this.userUuid;
            }
            form.bussinesUuid=form.type[0];
            form.typeCdUuid=form.type[1];
            form.purchaseDate=!!form.date?form.date:'';
            form.receipt_time=!!form.dateTime?form.dateTime:'';
            if(this.partList.length<=0){
                form.deptUuid=''
            }else{
                let arr=this.partList.map(item=>{
                    return item.uuid
                });
                if(!arr.includes(form.deptUuid)){
                    form.deptUuid=''
                }
            }
            let res=await saveEquip(form);
            let response=res.data;
            if(response.code==200){
                this.$Notice.success({
                    desc:"已保存"
                });
                this.formItem.pageNumber=1;
                this.getTable();
                this.modal_deviceInfo=false;
            }else{
                this.$Notice.error({
                    desc:response.msg
                });
            }
        },
        async validate(){
            if(this.user_type!='01'&&this.deviceInfo.customerUuid.length<=0){
                this.$Notice.error({
                    desc:"请选择设备所属客户"
                })
            }else if(this.deviceInfo.instUuid.length<=0){
                this.$Notice.error({
                    desc:"请选择所属机构"
                })
            }else if(this.deviceInfo.type.length<=0||this.deviceInfo.type[0]==null){
                this.$Notice.error({
                    desc:"请选择设备父类和子类"
                })
            }else if(this.deviceInfo.name.length<=0){
                this.$Notice.error({
                    desc:"请输入设备名称"
                })
            }else if(this.deviceInfo.name.length<=2){
                this.$Notice.error({
                    desc:"设备名称须大于2个字符"
                })
            }else{
                //save
                await this.save();
            }
            let that=this;
            this.saveLoad=false;
            setTimeout(()=>{
                that.saveLoad=true;
            },500)
        },
        changeKey(arr){
            let newArea = arr.map(item => {
                let a = {};
                a.label = item.name;
                a.value = item.uuid;
                if (!!item.children && item.children.length > 0) {
                    a.children = this.changeKey(item.children);
                }
                return a
            })
            return newArea
        },
        async getEquipTypeList(){
            let res =await getEquipType();
            let response=res.data;
            if(response.code==200){
                this.typeList=this.changeKey(response.data);
                this.moreTypeList=[{value:'全部',label:'全部',children:[{value:'全部',label:'全部'}]},...JSON.parse(JSON.stringify(this.typeList)).map(item=>{
                    if(!!item.children && item.children.length > 0){
                        item.children=[{value:'全部',value:'全部'},...item.children]
                    }
                    return item
                })];
            }else{
                this.$Notice.error({
                    desc:response.msg
                })
            }
        },
        async changeInst(value){
            this.deviceInfo.part='';
            let res =await getDeptList(value);
            let response=res.data;
            if(response.code==200){
                this.partList=response.data;
            }else{
                this.$Notice.error({
                    desc:response.msg
                })
            }
        },
        async formCustomerChange(value){
                //this.newSearchCustomerChange(this.deviceInfo.customerUuid,'form');
                await this.getFormInstTree(this.deviceInfo.customerUuid);
                this.deviceInfo.instUuid=this.editInst;
                this.deviceInfo.inst_name=this.editInstN;
                this.deviceInfo.deptUuid= this.editDept;
        },
        searchCustomerChange(value){
            this.getSearchInstTree(value);
            //this.newSearchCustomerChange(value,'search')
        },
        // async newSearchCustomerChange(value,type){
        //     if(value!=='全部'){
        //     let res =await getBankOrg(value,'','','')
        //     if(res.status===200){
        //         let response=res.data;
        //         if(response.code===200){
        //             if(type==='search'){
        //                 this.moreMechanismList=[{uuid:'全部',name:'全部'},...response.data]
        //             }else if(type==='form'){
        //                 this.mechanismList=response.data;
        //             }
        //         }else{
        //             this.$Notice.error({
        //                 title: '请求出错',
        //                 desc:response.msg
        //             });
        //         }
        //     }else{
        //         this.$Notice.error({
        //             title: '请求失败'
        //         });
        //     } 
        //     }else{
        //         this.formItem.inst='';
        //     }
        // },
        async getTransferInst(uuid){
            let res =await getBankOrg(uuid,'','','');
            let response=res.data;
            if(response.code===200){
                this.instlist=response.data;
                }else{
                    this.$Notice.error({
                        desc:response.msg
                    });
                }
        },
        searchGetTable(){
            this.formItem.pageNumber=1;
            this.getTable();
        },
        async getTable(){
            this.loading=true;
            let form=JSON.parse(JSON.stringify(this.formItem));
            for(let key in form){
                if(form[key]==='全部'){
                    form[key]='';
                }
            }
            if(!!this.timeRange[0]&&this.timeRange.length>0){
                form.startTime=util.time1(this.timeRange[0]);
                form.endTime=util.time1(this.timeRange[1]);
            }
            if(form.type.length>0){
                form.bussinessUuid=form.type[0]=='全部'?'':form.type[0];
                form.type_cd=form.type[1]=='全部'?'':form.type[1];
            }    
            let res=await getEquipTable(form);
            let response=res.data;
            if(response.code===200){
                this.total=response.data.total;
                this.data=response.data.rows.map(item=>{
                    item.time=item.created.slice(0,16);
                    return item
                })
                this.loading=false;
                this.downLoadUrl=`${url_equipList}${util.pjArgu(form)}`
            }else{
                this.$Notice.error({
                    desc:response.msg
                });
                
            }
        },
        pageSizeChange(size){
        //回到第一页
            this.formItem.pageNumber=1;
            this.formItem.pageSize=size;
            this.getTable();
        },
        pageChange(number){
            this.formItem.pageNumber=number;
            this.getTable();
        },
        handleClickAddForm(){
            this.infotype='add',
            this.modal_deviceInfo=true;
        },
        changeDate(date){
            this.deviceInfo.date=date;
        },
        changeDateTime(dateTime){
            this.deviceInfo.dateTime=dateTime;
        },
        handleClickVideoPlay(src){
            this.look_video_wrap.look_video=true;
            this.look_video_wrap.src=src;
        },
        handleClickPicLook(src){
        this.look_pic_wrap.look_pic=true;
        this.look_pic_wrap.src=src;
        },
        async getDetails(uuid){
            this.repaire_details=JSON.parse(JSON.stringify(this.empty_repaire_details));
            let res=await getRepaireDetails(uuid);
            let response=res.data;
            if(response.code===200){
                let {order_number,created,province,city,district,describe,faultType}=response.data.warning;
                let {name,mobile}=response.data.customer;
                let additional=response.data.board;
                let proName=!!response.data.pro?response.data.pro.name:'';
                let reason=!!response.data.reason?response.data.reason.content:'';
                let solve=!!response.data.solve?response.data.solve.content:'';
                let customername=response.data.customername;
                let equip=!!response.data.equip?response.data.equip.name:'';
                let attitude_score,skill_score,speed_score,content;
                let inst_name=response.data.instName;
                if(!!response.data.score&&!!response.data.score.attitude_score){
                    attitude_score=response.data.score.attitude_score;
                    skill_score=response.data.score.skill_score;
                    speed_score=response.data.score.speed_score;
                    content=response.data.score.content;
                }else{
                    attitude_score=null;
                    skill_score=null;
                    speed_score=null;
                    content=null;
                }
                let imageList=response.data.imageList;
                if(!!imageList){
                    imageList=[];
                }
                let video=response.data.video;
                let location=`${province} ${city}`;
                if(!!district){
                    location=`${location} ${district}`
                }
                let startTime=created.slice(0,16);
                this.repaire_details={
                    order_number,
                    startTime,
                    name,
                    mobile,
                    customername,
                    location,
                    inst_name,
                    equip,
                    describe,
                    imageList,
                    video,
                    additional,
                    proName,
                    faultType,
                    reason,
                    solve,
                    attitude_score,
                    skill_score,
                    speed_score,
                    content
                };
                this.modal_repaire_detail=true;
            }else{
                this.$Notice.error({
                    desc:response.msg
                });
            }
        },
    },
    watch:{
        infotype:function(){
            if(this.infotype==='add'){
                this.deviceInfoTitle="新增设备";
                this.classes=""
            }else if(this.infotype==='edit'){
                this.deviceInfoTitle="编辑设备信息";
                this.classes=""
            }else if(this.infotype==='view'){
                this.deviceInfoTitle="设备信息";
                this.classes="no_footer_modal"                
            }
        },
        modal_deviceInfo:function(){
            if(!this.modal_deviceInfo){
                this.resetForm();
                this.editInst='';
                this.editDept='';
                this.editInstN='';
            }
        }
    },
    created(){
        this.init();
        this.btnp=util.bpower(this,this.btn);
        this.getTable();
        this.getEquipTypeList();
    }
}

</script>
<style lang='scss' >
.detail-form{
  padding:15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-bottom:1px solid #eee;
  &-item{
    width:40%;
    padding: 5px 0;
    label{
      color:rgb(49, 48, 48);
    }
  }
  .detail-img-video{
    padding:5px 0 5px 70px;
    position:relative;
    width:100%;
    span{
      position: absolute;
      top:5px;
      left:0;
      color:rgb(49, 48, 48);
    }
    .wrap{
      display:flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      
      img,video{
        width:100px;
        height:100px;
        margin-bottom:10px;
        cursor: pointer;
      }
    }

  }
}
.detail-supplement{
  padding:10px 0 10px 40px;
  &-item{
    padding:6px 0;
    border-bottom:1px solid #eee;
    .spokesman{
      display: flex;
      align-items: center;
      margin-bottom:5px;
    }
    .speech{
      padding-left:50px;
      padding-right:20px;
    }
  }
}
.excel .ivu-upload-list{
    display:none!important;
}
</style>